# -*- coding:utf-8 -*-

from flask import Flask
import config
from Base.extension import db, CORS, redis_client
from Base.api.resource import api


def create_app():
    app = Flask(__name__)
    redis_client.init_app(app)
    app.config.from_object(config)

    db.init_app(app)
    # 验证
    CORS(app, supports_credentials=True, resources=r"/*")
    api.init_app(app)
    return app
